<%@ page import="org.internna.iwebjtracker.spring.mvc.ProjectController" %>
<%@ taglib prefix="iwebmvc" uri="http://tags.iwebmvc.com" %>
<%@ taglib prefix="iwebjtracker" tagdir="/WEB-INF/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<c-rt:set var="roadmap" value="<%= ProjectController.ROADMAP %>" />
<c-rt:set var="project" value="<%= ProjectController.PROJECT %>" />
<c-rt:set var="isAdmin" value="<%= ProjectController.PROJECT_ADMIN %>" />
<c-rt:set var="versionByStatus" value="<%= ProjectController.VERSION_BY_STATUS %>" />
<c-rt:set var="issueClass" value="<%= org.internna.iwebjtracker.model.DefaultIssue.class %>" />
<c-rt:set var="sessionUser" value="<%= org.internna.iwebmvc.security.UserManager.SESSION_USER %>" />
<iwebmvc:panel title="ui.roadmap.title" cssStyle="text-align:left" width="99%;margin:0;">
    <c:choose>
        <c:when test="${empty requestScope[roadmap]}"><iwebmvc:message argMessage="ui.roadmap.nothing" /></c:when>
        <c:otherwise>
            <div style="height:15px;width:99%;overflow:hidden">
                <span style="font-weight:bold"><iwebmvc:message argMessage="ui.roadmap.project" /></span>
                <span style="padding-left:5px">${requestScope[roadmap][0].name}</span>
            </div>
            <div dojoType="dijit.ProgressBar" progress="${requestScope[roadmap][0].percentage}"></div>
            <div class="overclear">
                <span class="float_left" style="font-weight:bold"><iwebmvc:message argMessage="ui.roadmap.closed" /></span>
                <span class="float_left" style="width:30px;text-align:right;display:inline-block"><a href="javascript:filterClosedIssues('${requestScope[project].alias}', '${iwebmvc:inferDWRConvertedJavascriptClass(issueClass)}', '<iwebmvc:message argMessage="Status.CLOSED" />')">${requestScope[roadmap][0].closed}</a></span>
                <span class="float_left" style="font-weight:bold;padding-left:5px"><iwebmvc:message argMessage="ui.roadmap.active" /></span>
                <span class="float_left" style="width:30px;text-align:right;display:inline-block"><a href="javascript:filterOpenIssues('${requestScope[project].alias}', '${iwebmvc:inferDWRConvertedJavascriptClass(issueClass)}', '<iwebmvc:message argMessage="Status.CLOSED" />')">${requestScope[roadmap][0].active}</a></span>
                <span class="float_right">(${requestScope[roadmap][0].total})</span>
            </div>
            <hr class="color_${sessionScope[sessionUser].theme}" style="height:1px;margin:5px;margin-top:5px;margin-bottom:5px;" />
            <div style="height:15px;width:98%;overflow:hidden;font-weight:bold"><iwebmvc:message argMessage="ui.roadmap.current;${requestScope[roadmap][1].name}" /></div>
            <div dojoType="dijit.ProgressBar" progress="${requestScope[roadmap][1].percentage}"></div>
            <div class="overclear">
                <span class="float_left" style="font-weight:bold"><iwebmvc:message argMessage="ui.roadmap.closed" /></span>
                <span class="float_left" style="width:30px;text-align:right;display:inline-block">${requestScope[roadmap][1].closed}</span>
                <span class="float_left" style="font-weight:bold;padding-left:5px"><iwebmvc:message argMessage="ui.roadmap.active" /></span>
                <span class="float_left" style="width:30px;text-align:right;display:inline-block">${requestScope[roadmap][1].active}</span>
                <span class="float_right">(${requestScope[roadmap][1].total})</span>
            </div>
            <hr class="color_${sessionScope[sessionUser].theme}" style="height:1px;margin:5px;margin-top:5px;margin-bottom:5px;" />
            <div style="height:15px;width:98%;overflow:hidden;font-weight:bold"><iwebmvc:message argMessage="ui.roadmap.otherversions" /></div>
            <div dojoType="dijit.ProgressBar" progress="${requestScope[roadmap][2].percentage}"></div>
            <div class="overclear">
                <span class="float_left" style="font-weight:bold"><iwebmvc:message argMessage="ui.roadmap.closed" /></span>
                <span class="float_left" style="width:30px;text-align:right;display:inline-block">${requestScope[roadmap][2].closed}</span>
                <span class="float_left" style="font-weight:bold;padding-left:5px"><iwebmvc:message argMessage="ui.roadmap.active" /></span>
                <span class="float_left" style="width:30px;text-align:right;display:inline-block">${requestScope[roadmap][2].active}</span>
                <span class="float_right">(${requestScope[roadmap][2].total})</span>
            </div>
            <hr class="color_${sessionScope[sessionUser].theme}" style="height:1px;margin:5px;margin-top:5px;margin-bottom:5px;" />
            <div class="overclear">
                <span class="float_left" style="font-weight:bold"><iwebmvc:message argMessage="ui.roadmap.unassigned" /></span>
                <span class="float_right">(${requestScope[roadmap][3].total})</span>
            </div>
        </c:otherwise>
    </c:choose>
</iwebmvc:panel>
<div class="panelSeparator"></div>
<iwebmvc:panel title="ui.project.statistics.versionByStatus" width="99%;margin:0" cssStyle="text-align:left">
    <c:if test="${not empty requestScope[versionByStatus][0]}">
        <div style="padding:0;margin:0"><img src="http://chart.apis.google.com/chart?chs=205x143&cht=p3&chd=t:<c:forEach items="${requestScope[versionByStatus][0]}" var="status" varStatus="loopIndex">${status.value}<c:if test="${not loopIndex.last}">,</c:if></c:forEach>&chdlp=b&chco=<c:choose><c:when test='${sessionScope[sessionUser].theme == "nihilo"}'>FF9900</c:when><c:when test='${sessionScope[sessionUser].theme == "soria"}'>3366CC</c:when><c:otherwise>585858</c:otherwise></c:choose>&chdl=<c:forEach items="${requestScope[versionByStatus][0]}" var="status" varStatus="loopIndex"><iwebmvc:message argMessage="Status.${status.key}" /><c:if test="${not loopIndex.last}">|</c:if></c:forEach>" /></div>
    </c:if>
</iwebmvc:panel>
<div class="panelSeparator"></div>
<iwebmvc:panel title="ui.project.statistics.versionByResolution" width="99%;margin:0" cssStyle="text-align:left">
    <c:if test="${not empty requestScope[versionByStatus][1]}">
        <div style="padding:0;margin:0"><img src="http://chart.apis.google.com/chart?chs=205x143&cht=p3&chd=t:<c:forEach items="${requestScope[versionByStatus][1]}" var="status" varStatus="loopIndex">${status.value}<c:if test="${not loopIndex.last}">,</c:if></c:forEach>&chdlp=b&chco=<c:choose><c:when test='${sessionScope[sessionUser].theme == "nihilo"}'>FF9900</c:when><c:when test='${sessionScope[sessionUser].theme == "soria"}'>3366CC</c:when><c:otherwise>585858</c:otherwise></c:choose>&chdl=<c:forEach items="${requestScope[versionByStatus][1]}" var="status" varStatus="loopIndex"><iwebmvc:message argMessage="ResolutionStatus.${status.key}" /><c:if test="${not loopIndex.last}">|</c:if></c:forEach>" /></div>
    </c:if>
</iwebmvc:panel>